<template>
	<view class="max">
		<view class="max">
			<swiper class="max" :indicator-dots="indicatorDots" :autoplay="autoplay" :duration="duration" @change="cg">
				<swiper-item class="max">
					<view class="max cen">
						<img src="../../pages/start/diyi.jpg">
					</view>
				</swiper-item>
				<swiper-item class="max">
					<view class="max cen">
						<img src="../../pages/start/dire.jpg">
					</view>
				</swiper-item>
				<swiper-item class="max">
					<view class="max cen">
						<img src="../../pages/start/disan.jpg">
					</view>
				</swiper-item>
			</swiper>
		</view>
	</view>
	
</template>

<script>
	export default {
		data() {
			return {
				indicatorDots: true,
				autoplay: true,
				interval: 3000,
				duration: 500,
				timer: null
			}
		},
		methods: {
			cg(e) {
				if (e.detail.current == 2) {
					this.timer = setTimeout(() => {
						uni.redirectTo({
							url: '/pages/index/index'
						});
					}, 5000);
				}
			}
		},
		beforeDestroy() {
			clearTimeout(this.timer);
			this.timer = null
		}
	}
	// export default{
	// 	methods:{
	// 		swiperChange{
	// 			if(e.detail.current==0){
	// 				uni.s
	// 			}
	// 		}
	// 	}
	// }
</script>

<style scoped>
	.max {
		width: 100%;
		height: 100%;

	}

	page {
		width: 100%;
		height: 100%;

	}

	img {
		width: 100%;
		height: 100%;

	}

	.cen {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}
</style>
